package com.zretc.controller;

import com.zretc.service.OrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/moviesBox")
public class MoviesBoxOfficeController {

    @Autowired
    private OrderDetailService orderDetailService;

    @RequestMapping("/getCinemaBox")
    @ResponseBody
    public List<Map<String,Object>> getBoxOfficeByCinema(Integer isDelete){
        // 调用业务层获取电影票房
        List<Map<String, Object>> cinemaNameAndBox = orderDetailService.getCinemaNameAndBox(isDelete);
        return cinemaNameAndBox;
    }

    @RequestMapping("/getMovieBox")
    @ResponseBody
    public List<Map<String,Object>> getBoxOfficeByMovie(Integer isDelete){
        // 调用业务层获取电影票房
        List<Map<String, Object>> movieNameAndBox = orderDetailService.getMovieNameAndBox(isDelete);
        return movieNameAndBox;
    }

}
